#ifndef JUDGE_H
#define JUDGE_H

#ifdef __cplusplus
extern "C"
{
#endif

extern const char* languages[];
extern const char* testfiles[];
extern const int testCount;
int SetOutputFile(char *file);
int SetErrorFile(char *file);
char *RunJudge(const char *language,
                int judgeType,
                const char *filename,
                const char *initPath,
                const char *dataPath,
                const char *spjPath,
                int timeLimit,
                int memoryLimit,
                int compareFlag,
                int ruler,
                int querySet,
                const char *eps,
                const char *userCachePath,
                const char *spjCachePath
                );
// 后期要修改的版本
char *RunJudgeByJsonFile(const char* json_file);

#ifdef ENABLE_DB_JUDGE
/*
file content:

[DATABASE_JUDGE]
MYSQL_HOST=localhost
MYSQL_PORT=3306
MYSQL_ROOT_USER=root
MYSQL_ROOT_PASSWD=root
MYSQL_VISITOR_USER=user
MYSQL_VISITOR_PASSWD=user
*/
int InitDatabaseParamsFromFile(const char* file);
int InitDatabaseParams( const char* host,
                        int port,
                        const char* rootUser,
                        const char* rootPasswd,
                        const char* visitorUser,
                        const char* visitorPasswd);
#endif

#ifdef __cplusplus
}
#endif

#endif